<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp"%>

<head>
    <title>登录</title>
</head>
<body id="login"/>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tbody><tr>
        <td width="33"></td>
        <td width="229"> </td>
        <td width="16"> </td>
        <td width="632"> </td>
        <td> </td>
      </tr>
      <tr>
        <td width="33"> </td>
        <td width="229">
        <form method="post" id="loginForm" action="<c:url value='/j_security_check'/>"
    		onsubmit="saveUsername(this);return validateForm(this)">
        <table cellspacing="0" cellpadding="0" width="100%" border="0">
          <tbody><tr>
            <td height="26"><img height="26" width="229" src="../images/new/main/main/login/hydl_top.gif"/></td>
          </tr>
          <tr>
            <td background="../images/new/main/main/login/hydl_mid.gif"><table cellspacing="0" cellpadding="0" border="0">
              <tbody>
			  <tr>
                <td width="17" rowspan="5"></td>
                <td height="10" colspan="3"><c:if test="${param.error != null}">
    <li class="error">
        <img src="${ctx}/images/iconWarning.gif" alt="<fmt:message key='icon.warning'/>" class="icon"/>
        <s:property  value="errorMessage"/>
        <%--${sessionScope.SPRING_SECURITY_LAST_EXCEPTION_KEY.message}--%>
    </li>
</c:if>		   </td>
                </tr>
              <tr>
                <td nowrap="nowrap" height="25" width="49"> <div align="right">用户名：</div></td>
                <td height="25" width="93"><label>
                  <input type="text" style="height:14px;" size="13" name="j_username" id="j_username" tabindex="1"/>
                </label></td>
                <td height="25" width="70"> </td>
              </tr>
              <tr>
                <td height="25"><div align="right">密码：</div></td>
                <td height="25" width="93"><input type="password" style="height:14px;" size="13" name="j_password" id="j_password" tabindex="2" /></td>
                <td height="25"><div align="center"><a href="<s:url value="/jsp/register/findPassword.jsp"/>">忘记密码</a>?</div></td>
              </tr>
              <tr>
                <td height="30"> </td>
                <td colspan="2">
                  <input type="checkbox" style="float: left;" name="_spring_security_remember_me" id="rememberMe" tabindex="3"/><label style="margin: 1px 0pt 0pt 5px; display: block; float: left;">
                  让系统记住我</label></td>
                </tr>
              
              <tr>
                <td> </td>
                <td><table cellspacing="0" cellpadding="0" width="82" border="0">
                  <tbody><tr>
                    <td >
                    	<input type="submit" style="width:82px;height:25px;border:none;color:#FFFFFF;background:url(../images/new/main/main/login/button_orange.gif) no-repeat;" value="登录"/>
                    </td>
                  </tr>
                </tbody></table></td>
                <td height="40"> </td>
              </tr>
              
            </tbody></table></td>
          </tr>
          <tr>
            <td><img height="5" width="229" src="../images/new/main/main/login/hydl_bottom.gif"/></td>
          </tr>
        </tbody></table>
        </form>
        </td>
        <td width="16"> </td>
        <td><table cellspacing="0" cellpadding="0" width="100%" border="0">
          <tbody><tr>
            <td valign="bottom" background="../images/new/main/main/login/ditu_2.gif"><table height="86" cellspacing="0" cellpadding="0" width="100%" border="0">
              <tbody>
              <tr>
                <td><div style="margin-left: 15px;">
              <ul style="display:block;list-style-type:none;margin:0;padding:0;">
                <li style="display:block;list-style-type:none;margin:0;padding:0;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目前正在试运行阶段，难免有些小问题，请多包涵：）</li>
              </ul>
            </div></td>
              </tr>
            </tbody></table></td>
            <td width="217" valign="bottom"><img height="86" width="148" align="top" src="../images/new/main/main/login/picture.gif"/></td>
          </tr>
          
          
        </tbody></table>          
          <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody><tr>
              <td height="20">  </td>
            </tr>
            <tr>
              <td><a href="<c:url value="/register/register-input.do"/>"><img src="../images/new/main/main/login/buttom_zhuce.png"/></a></td>
            </tr>
          </tbody></table></td>
        <td> </td>
      </tr>
      <tr>
        <td width="33"> </td>
        <td width="229"> </td>
        <td width="16"> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td width="33"> </td>
        <td width="229"> </td>
        <td width="16"> </td>
        <td> </td>
        <td width="50"> </td>
      </tr>

    </tbody></table>



<script type="text/javascript">
	if (getCookie("username") != null) {
        $("j_username").value = getCookie("username");
        $("j_password").focus();
    } else {
        $("j_username").focus();
    }   
    function saveUsername(theForm) {
        var expires = new Date();
        expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // sets it for approx 30 days.
        setCookie("username",theForm.j_username.value,expires,"<c:url value="/"/>");
    }
    
    function validateForm(form) {                                                               
        return validateRequired(form); 
    } 
    
    function passwordHint() {
        if ($("j_username").value.length == 0) {
            alert("<s:text name="errors.requiredField"><s:param><s:text name="label.username"/></s:param></s:text>");
            $("j_username").focus();
        } else {
            location.href="<c:url value="/passwordHint.html"/>?username=" + $("j_username").value;     
        }
    }
    
    function required () { 
        this.aa = new Array("j_username", "<s:text name="errors.requiredField"><s:param><s:text name="label.username"/></s:param></s:text>", new Function ("varName", " return this[varName];"));
        this.ab = new Array("j_password", "<s:text name="errors.requiredField"><s:param><s:text name="label.password"/></s:param></s:text>", new Function ("varName", " return this[varName];"));
    } 
</script>


